import { StationVO } from '@/api/station/types';
import { VxeGridProps } from 'vxe-table';
import { BizStationLeakSummaryVo } from '@/api/station/leak/types';

export function getTableConfig(): VxeGridProps<BizStationLeakSummaryVo> {
  return {
    id: 'tenant',
    loading: false,
    height: 'auto',
    autoResize: true,
    border: 'inner',

    resizable: true,
    showOverflow: 'tooltip',
    stripe: true,
    rowConfig: {
      isHover: true,
      keyField: 'id'
      // height: 56
    },
    customConfig: {
      storage: true
    },
    columns: [
      { title: '序号', type: 'seq', width: 50 },
      { sortable: true, field: 'stationName', title: '站房名称' },
      { sortable: true, field: 'location', title: '区域' },
      { sortable: true, field: 'leakStatus', title: '状态', slots: { default: 'status' } },
      { sortable: true, field: 'leakStateTime', title: '状态切换时间' },
      { sortable: true, field: 'leakStateKeepDays', title: '持续时长（天）' },
      { sortable: true, field: 'pmax', title: '压力上限(帕)' },
      { sortable: true, field: 'pmin', title: '压力下限(帕)' },
      { sortable: true, field: 'handle', title: '操作', width: '120px', slots: { default: 'handle' } }
    ],
    data: [] as BizStationLeakSummaryVo[]
  };
}
